package com.hangzhou.welbeing.welbeinginstrument.activity;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;

import com.hangzhou.welbeing.welbeinginstrument.R;
import com.hangzhou.welbeing.welbeinginstrument.utils.Utils;


/**
 * 时间 2017 年 08 月 10.
 * 作者 Administrator  刘传华
 * 公司 杭州惟君医疗科技有限公司
 * 包名 com.hangzhou.welbeing.pregnant.welbeing_pregnant.activity
 * 工程名  welbeing_pregnant
 */
public class SplashActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);


        Utils.setStatusBar(this,false,false);
        Utils.setStatusTextColor(true,this);
        SharedPreferences sp = getSharedPreferences("second_app_internal_data", 0);
        boolean is_login = sp.getBoolean("is_login", false);
        if (is_login) {
            Intent intent = new Intent(SplashActivity.this,MainActivity.class);
            startActivity(intent);
            finish();
            overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
        }else{
                Intent intent = new Intent(SplashActivity.this,EntranceActivity.class);
                startActivity(intent);
                finish();
            overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
        }


    }
}
